The technical field is related to mechanisms and methods for testing computer microarchitectures.
The preferred method of emulating an instruction set on a microprocessor is to convert each emulated instruction (macroinstructions) into a series of instructions in the native instruction set (microinstructions). These microinstruction sequences are stored in microcode storage. In addition, the microprocessor may provide microinstructions that are only available for use by emulation hardware and not to code running in the native mode.
With traditional techniques for testing the emulated instruction set, test writers prepare sequences of user visible macroinstructions. The emulation hardware translates the macroinstructions into microinstructions that are then executed. In order to test certain microarchitectural features, the test writer must determine sequences of macroinstructions required to produce a desired sequence of microinstructions. The microinstruction sequences may be difficult (or even impossible) to construct with only macroinstructions. Further, a long sequence of macroinstructions may be required in order to produce the desired operands or machine state, leading to excessively long tests.
An improved method of testing computer microarchitectures has a test writer create a test sequence written directly in microinstructions (both native-mode and emulation-only microinstructions). This user-specified sequence is then inserted into reprogrammable microcode storage, replacing the normal sequence of microinstructions for a given macroinstruction. In order to execute the microinstructions, the test writer can issue the given macroinstruction. The method may be implemented in a simulation model where any set of microinstructions in the reprogrammable microcode storage can be easily replaced. The method may also be applied to an actual microprocessor implementation.
The method has the following advantages over current methods for testing computer microarchitectures: 1) the method allows much more precise control of microarchitectural features such as operands, timing and parallelism that may be very difficult to achieve with macroinstructions; 2) the method allows tests to be written more efficiently; 3) the method shields the test writer from changes in the microcode; and 4) the method allows the test writer to test sequences of events that are not possible in a design, but may be required at later steps in the design process.